package com.sxkiler.demo.seata.controller;

import com.sxkiler.demo.seata.dto.BusinessDTO;
import com.sxkiler.demo.seata.model.CommonResponse;
import com.sxkiler.demo.seata.service.at.ATBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business/at")
public class ATBusinessController {
    
    @Autowired
    ATBusinessService businessService;


    @RequestMapping("/buy")
    public CommonResponse handleBusiness(@RequestBody BusinessDTO businessDTO) throws Exception {
        businessService.handleBusiness(businessDTO);
        return CommonResponse.success();
    }
}
